syms theta1 theta2 theta3 theta4 theta5 theta6
T01=[cos(theta1) -sin(theta1) 0 0 ; 
    sin(theta1) cos(theta1) 0 0; 
    0 0 1 113.9;
    0 0 0 1 ];
T12=[cos(theta2) -sin(theta2) 0 0;
    0 0 -1 0;
    sin(theta2) cos(theta2) 0 0;
    0 0 0 1];
T23=[cos(theta3) -sin(theta3) 0 -351 ; 
    sin(theta3) cos(theta3) 0 0; 
    0 0 1 0; 
    0 0 0 1];
T34=[cos(theta4) -sin(theta4) 0 -334.5 ;
    sin(theta4) cos(theta4) 0 0;
    0 0 1 102; 
    0 0 0 1];
T45=[cos(theta5) -sin(theta5) 0 0;
    0 0 -1 -102.3;
    sin(theta5) cos(theta5) 0 0; 
    0 0 0 1];
T56=[cos(theta6) -sin(theta6) 0 0;
    0 0 1 56.8;
    -sin(theta2) -cos(theta2) 0 0;
    0 0 0 1];
T06=T01*T12*T23*T34*T45*T56;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   